//vuex接口文件
import store from "./store";

const mixin = {
  computed: {
    list: function() {
        console.log(222222222)
      return this.$store.state.detailsList;
    },
   
  },
  methods: {
    // changeCoung() {
    //   store.commit("CHANGE_COUNT")
    // },
    ShoppingCart_add(data) {
      console.log(data);
      return store.commit("SHOPPINGCART_ADDTO", data);
      // console.log(this.$store.computed.detailsList);
    },
    SHOPPINGCART_QLUS(id) {
      return store.commit("SHOPPINGCART_QLUS", id);
    },
    SHOPPINGCART_MINUS(id) {
      return store.commit("SHOPPINGCART_MINUS", id);
    },
    // 删除
    ShoppingCart_remove(id) {
      return store.commit("SHOPPINGCART_REMOVE", id);
    },
 
    
  },
};

export default mixin;
/***
 * 使用方法：
 * 3、在组件中引入import mixin from "../../store/index"（宏入）
 * mixins:[mixin]
 * 4、用this调用方法
 */
